import 'package:flutter/material.dart' hide Action;
import 'package:flutter_dva/flutter_dva.dart';
import 'package:flutter_ui/src/models/nav-model.dart';
import 'package:flutter_ui/src/models/system-model.dart';
import 'app.dart';

Dva dva = Dva(DvaOpts(
initialState: <String, StoreOfState<dynamic>>{},
models: [
  NavModel(),
  SystemModel(),
]));


void main() async {
  WidgetCreatorFunction app = await dva.start(() => MyApp(), () async {
    ReduxPersistor persistor = new ReduxPersistor(store: dva.store, heartBeat: 1500);
    await persistor.persist();
    // 持久化完成后通知，跳转页面
    dva.store.dispatch(Action("system/bootstrap", null));
  }, waitCllabck: true);
  runApp(app());
} 
